home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- subject: v10i014: mp V2.3 - a PostScript pretty printer for mail etc.. (Part 2 of 2).
- from: richb@Aus.Sun.COM (Rich Burridge)
- Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 10, Issue 14
- Submitted-by: richb@Aus.Sun.COM (Rich Burridge)
- Archive-name: mp23/part02
-
- ---- Cut Here and unpack ----
- #!/bin/sh
- # this is part 2 of a multipart archive
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file mp.1 continued
- #
- CurArch=2
- if test ! -r s2_seq_.tmp
- then echo "Please unpack part 1 first!"
- exit 1; fi
- ( read Scheck
- if test "$Scheck" != $CurArch
- then echo "Please unpack part $Scheck next!"
- exit 1;
- else exit 0; fi
- ) < s2_seq_.tmp || exit 1
- echo "x - Continuing file mp.1"
- sed 's/^X//' << 'SHAR_EOF' >> mp.1
- XEditing this file will allow you to introduce some stylistic variation
- Xin the printing of mail.
- X.TP
- X.B /usr/local/lib/mp.pro.filofax.ps
- XPostscript prologue used to print out files in Filofax format.
- X.TP
- X.B /usr/local/lib/mp.pro.timeman.ps
- XPostScript prologue used to print out files in Time Manager format.
- X.SH "SEE ALSO"
- Xmail(1)
- X.SH AUTHORS
- XOriginal version by Steve Holden.
- X.br
- XConverted to C, modified and maintained by Rich Burridge, Sun Microsystems Australia,
- X.br
- XOriginal modified to handle net news articles and MH mail by Bruno Pillard, Chorus Systemes, France,
- X.br
- XHandling of mail digests added by Dave Glowacki of Public Works Computer Services, St Paul, MN.
- X.br
- XManual page for the initial version revised by Rick Rodgers, UCSF School of Pharmacy, San Francicso.
- X.br
- XSupport for Personal Organiser printing style added by Douglas Buchanan,
- XSun Microsystems Europe.
- X.br
- XSubstantial modifications to header parsing by Jeremy Webber,
- XComputer Science Department, University of Adelaide, Australia.
- X.br
- XSupport for printing multiple files and subject line filename print for
- Xordinary files added by Sam Manoharan, Edinburgh University.
- SHAR_EOF
- echo "File mp.1 is complete"
- chmod 0444 mp.1 || echo "restore of mp.1 fails"
- set `wc -c mp.1`;Sum=$1
- if test "$Sum" != "4500"
- then echo original size 4500, current size $Sum;fi
- echo "x - extracting mp.pro.ps (Text)"
- sed 's/^X//' << 'SHAR_EOF' > mp.pro.ps &&
- X%!PS-Adobe-1.0
- X%%Creator: Steve Holden
- X%%Modifed: Rich Burridge
- X%%Title: @(#)mp.pro.ps 1.4 89/05/09
- X%%CreationDate: see above
- X%%DocumentFonts: Times-Bold Times-Roman Courier
- X%%Pages: (atend)
- X%%PageLength 60
- X%%LineLength 80
- X%%EndComments
- X
- X%Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).
- X
- X/backspacefont {
- X /Courier findfont dup length dict begin
- X { %forall
- X 1 index /FID eq { pop pop } { def } ifelse
- X } forall
- X currentdict /UniqueID known { %if
- X /UniqueID UniqueID 16#800000 xor def
- X } if
- X CharStrings length 1 add dict begin
- X CharStrings { def } forall
- X /backspace { -600 0 setcharwidth } bind def
- X currentdict
- X end
- X /CharStrings exch def
- X /Encoding Encoding 256 array copy def
- X Encoding 8 /backspace put
- X currentdict
- X end
- X definefont
- X} bind def
- X
- X/CourierBack backspacefont
- X
- X/font1d /Times-Bold findfont 10 scalefont def
- X/font2d /Times-Roman findfont 10 scalefont def
- X/font3d /CourierBack findfont 9 scalefont def
- X/fontHd /Helvetica-BoldOblique findfont 14 scalefont def
- X/fontH2 /Helvetica-BoldOblique findfont 10 scalefont def
- X/fontNd /Times-Bold findfont 12 scalefont def
- X
- X/BoldFont { font1d setfont } def
- X/PrimaryFont { font2d setfont } def
- X/SecondaryFont { font3d setfont } def
- X/fontH { fontHd setfont } def
- X/fontD { fontH2 setfont } def
- X/fontN { fontNd setfont } def
- X
- XSecondaryFont
- X
- X/endpage
- X{
- X gsave
- X fontH
- X newpath
- X 90 756 moveto
- X 100 736 10 180 270 arc
- X 536 736 10 270 0 arc
- X 536 756 10 0 90 arc
- X 100 756 10 90 180 arc
- X closepath
- X 0.75 setgray fill
- X newpath
- X 318 746 15 0 360 arc
- X gsave
- X 1 setgray fill
- X grestore
- X closepath
- X 0 setgray stroke
- X 100 740 moveto
- X MailFor show
- X User show
- X fontD
- X TimeNow stringwidth pop neg 536 add 740 moveto TimeNow show
- X fontN
- X dup stringwidth pop 2 div neg 318 add 740 moveto show
- X fontH
- X newpath
- X 90 60 moveto
- X 100 40 10 180 270 arc
- X 536 40 10 270 0 arc
- X 536 60 10 0 90 arc
- X 100 60 10 90 180 arc
- X closepath
- X 0.75 setgray fill
- X 0 setgray
- X 100 44 moveto Subject show
- X grestore
- X showpage % display it
- X newpage % reset parameters for next
- X} def
- X
- X/newpage
- X{
- X /lct 0 def
- X /ypos 700 def
- X 100 ypos moveto
- X} def
- X
- X/showline
- X{
- X show
- X /ypos ypos 10 sub def
- X 100 ypos moveto
- X} def
- X
- Xnewpage % establish first page parameters
- SHAR_EOF
- chmod 0444 mp.pro.ps || echo "restore of mp.pro.ps fails"
- set `wc -c mp.pro.ps`;Sum=$1
- if test "$Sum" != "2488"
- then echo original size 2488, current size $Sum;fi
- echo "x - extracting mp.pro.filofax.ps (Text)"
- sed 's/^X//' << 'SHAR_EOF' > mp.pro.filofax.ps &&
- X%!PS-Adobe-1.0
- X%%Creator: Steve Holden
- X%%Modifed: Rich Burridge
- X%%Title: @(#)mp.pro.filofax.ps 1.3 89/05/09
- X%%CreationDate: see above
- X%%PageLength 60
- X%%LineLength 80
- X%%DocumentFonts: Times-Bold Times-Roman Courier
- X%%Pages: (atend)
- X%%EndComments
- X
- X%Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).
- X
- X/backspacefont {
- X /Courier findfont dup length dict begin
- X { %forall
- X 1 index /FID eq { pop pop } { def } ifelse
- X } forall
- X currentdict /UniqueID known { %if
- X /UniqueID UniqueID 16#800000 xor def
- X } if
- X CharStrings length 1 add dict begin
- X CharStrings { def } forall
- X /backspace { -600 0 setcharwidth } bind def
- X currentdict
- X end
- X /CharStrings exch def
- X /Encoding Encoding 256 array copy def
- X Encoding 8 /backspace put
- X currentdict
- X end
- X definefont
- X} bind def
- X
- X/CourierBack backspacefont
- X
- X/font1d /Times-Bold findfont 11 scalefont def
- X/font2d /Times-Roman findfont 11 scalefont def
- X/font3d /CourierBack findfont 10 scalefont def
- X/fontHd /Helvetica-BoldOblique findfont 15 scalefont def
- X/fontH2 /Helvetica-BoldOblique findfont 10 scalefont def
- X/fontNd /Times-Bold findfont 12 scalefont def
- X
- X/BoldFont { font1d setfont } def
- X/PrimaryFont { font2d setfont } def
- X/SecondaryFont { font3d setfont } def
- X/fontH { fontHd setfont } def
- X/fontD { fontH2 setfont } def
- X/fontN { fontNd setfont } def
- X
- XSecondaryFont
- X%% stick in all the fudge factors here. May need changing for page sizes,
- X%% laserwriter setups etc?
- X%%
- X/binderspace 100 def
- X/filowidth 484 def
- X/filoheight 972 def
- X/margin 12 def
- X/xleft binderspace 6 add def
- X/yco filoheight 50 sub def % space at the top
- X/xright filowidth binderspace add 30 sub def % space at right
- X
- X/endpage
- X{
- X gsave
- X fontH
- X % draw the top for owner
- X newpath
- X xleft 10 sub yco moveto
- X xleft yco 20 sub 10 180 270 arc
- X xright yco 20 sub 10 270 0 arc
- X xright yco 10 0 90 arc
- X xleft yco 10 90 180 arc
- X closepath
- X 0.90 setgray fill
- X% newpath
- X% 318 864 15 0 360 arc
- X% gsave
- X% 1 setgray fill
- X% grestore
- X% closepath
- X 0 setgray stroke
- X xleft yco 16 sub moveto
- X MailFor show
- X User show
- X fontD
- X TimeNow stringwidth pop neg xright add yco 16 sub moveto TimeNow show
- X fontN
- X % dup stringwidth pop 2 div neg 318 add 858 moveto show
- X fontH
- X % lower box for subject etc
- X newpath
- X xleft 10 sub 60 moveto
- X xleft 40 10 180 270 arc
- X xright 40 10 270 0 arc
- X xright 60 10 0 90 arc
- X xleft 60 10 90 180 arc
- X closepath
- X 0.90 setgray fill
- X % stick the page number just a few points in from the right hand edge
- X newpath
- X xright 10 sub 50 15 0 360 arc
- X gsave
- X 1 setgray fill
- X grestore
- X closepath
- X 0 setgray stroke
- X xleft 44 moveto Subject show
- X fontN
- X % position and print the page number
- X dup stringwidth pop 2 div neg xright 10 sub add 46 moveto show
- X fontH
- X grestore
- X modu 2 eq eof 0 ne or { showpage } if % do a 'form feed'
- X % if ready for it
- X eof 0 eq { newpage } if % reset parameters for next if not end of file
- X} def
- X
- X/endfile
- X{
- X /eof 1 def
- X endpage
- X} def
- X
- X/xo 36 def
- X/yo 0 def
- X/pageno 0 def
- X/modu pageno 3 mod def % get mod to work out page pos
- X/eof 0 def
- X
- X/weearc % draws a little arc to show where the holes go
- X{ newpath
- X xo yo 4 0 360 arc
- X closepath
- X fill
- X} def
- X
- X/filopage
- X{ gsave
- X% 24 -118 translate
- X /xstart filowidth modu mul def
- X /xstart xstart binderspace add def
- X /xfin xstart filowidth add def
- X modu 0 eq { % first break
- X /yo 130 def % show where the holes should be punched
- X weearc % except that they will normally be off the edge of
- X /yo 238 def % the page
- X weearc
- X /yo 346 def
- X weearc
- X /yo 639 def
- X weearc
- X /yo 742 def
- X weearc
- X /yo 850 def
- X weearc
- X } if
- X [1 4] 0 setdash % use dashed lines for marker
- X newpath
- X xstart 0 moveto
- X xfin 0 lineto
- X xfin filoheight lineto
- X stroke
- X grestore
- X} def
- X
- X/newpage
- X{
- X pageno 0 eq { % set initial values for landscape drawing
- X 0.5 0.5 scale
- X 90 rotate
- X -50 0 translate
- X gsave % save state for easy restore
- X /eof 0 def
- X } {
- X grestore gsave % return to preferred original state
- X } ifelse % initial setup
- X
- X /modu pageno 3 mod def % get mod to work out page pos
- X 0 0 filoheight sub translate % initial position (-filoheight)
- X filopage % draw neccessary page breaks
- X /times filowidth modu mul def % shift origin as far right as needed
- X /times times margin add def % move right by fudge factor 12
- X times 0 translate
- X /lct 0 def
- X /ypos filoheight 110 sub def
- X xleft ypos moveto
- X /pageno pageno 1 add def % add one for the next time
- X} def
- X
- X/showline
- X{
- X show
- X /ypos ypos 12 sub def
- X xleft ypos moveto
- X} def
- X
- Xnewpage % establish first page parameters
- SHAR_EOF
- chmod 0444 mp.pro.filofax.ps || echo "restore of mp.pro.filofax.ps fails"
- set `wc -c mp.pro.filofax.ps`;Sum=$1
- if test "$Sum" != "4819"
- then echo original size 4819, current size $Sum;fi
- echo "x - extracting mp.pro.timeman.ps (Text)"
- sed 's/^X//' << 'SHAR_EOF' > mp.pro.timeman.ps &&
- X%!PS-Adobe-1.0
- X%%Creator: Steve Holden
- X%%Modifed: Rich Burridge
- X%%Title: @(#)mp.pro.timeman.ps 1.3 89/05/09
- X%%CreationDate: see above
- X%%PageLength 60
- X%%LineLength 80
- X%%DocumentFonts: Times-Bold Times-Roman Courier
- X%%Pages: (atend)
- X%%EndComments
- X
- X%Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).
- X
- X/backspacefont {
- X /Courier findfont dup length dict begin
- X { %forall
- X 1 index /FID eq { pop pop } { def } ifelse
- X } forall
- X currentdict /UniqueID known { %if
- X /UniqueID UniqueID 16#800000 xor def
- X } if
- X CharStrings length 1 add dict begin
- X CharStrings { def } forall
- X /backspace { -600 0 setcharwidth } bind def
- X currentdict
- X end
- X /CharStrings exch def
- X /Encoding Encoding 256 array copy def
- X Encoding 8 /backspace put
- X currentdict
- X end
- X definefont
- X} bind def
- X
- X/CourierBack backspacefont
- X
- X/font1d /Times-Bold findfont 12 scalefont def
- X/font2d /Times-Roman findfont 12 scalefont def
- X/font3d /CourierBack findfont 11 scalefont def
- X/fontHd /Helvetica-BoldOblique findfont 15 scalefont def
- X/fontH2 /Helvetica-BoldOblique findfont 10 scalefont def
- X/fontNd /Times-Bold findfont 12 scalefont def
- X
- X/BoldFont { font1d setfont } def
- X/PrimaryFont { font2d setfont } def
- X/SecondaryFont { font3d setfont } def
- X/fontH { fontHd setfont } def
- X/fontD { fontH2 setfont } def
- X/fontN { fontNd setfont } def
- X
- XSecondaryFont
- X%% stick in all the fudge factors here. May need changing for page sizes,
- X%% laserwriter setups etc?
- X%%
- X/binderspace 100 def
- X/filowidth 520 def
- X/filoheight 1024 def
- X/margin 12 def
- X/xleft binderspace 6 add def
- X/yco filoheight 50 sub def % space at the top
- X/xright filowidth binderspace add 30 sub def % space at right
- X
- X/endpage
- X{
- X gsave
- X fontH
- X % draw the top for owner
- X newpath
- X xleft 10 sub yco moveto
- X xleft yco 20 sub 10 180 270 arc
- X xright yco 20 sub 10 270 0 arc
- X xright yco 10 0 90 arc
- X xleft yco 10 90 180 arc
- X closepath
- X 0.90 setgray fill
- X% newpath
- X% 318 864 15 0 360 arc
- X% gsave
- X% 1 setgray fill
- X% grestore
- X% closepath
- X 0 setgray stroke
- X xleft yco 16 sub moveto
- X MailFor show
- X User show
- X fontD
- X TimeNow stringwidth pop neg xright add yco 16 sub moveto TimeNow show
- X fontN
- X % dup stringwidth pop 2 div neg 318 add 858 moveto show
- X fontH
- X % lower box for subject etc
- X newpath
- X xleft 10 sub 60 moveto
- X xleft 40 10 180 270 arc
- X xright 40 10 270 0 arc
- X xright 60 10 0 90 arc
- X xleft 60 10 90 180 arc
- X closepath
- X 0.90 setgray fill
- X % stick the page number just a few points in from the right hand edge
- X newpath
- X xright 10 sub 50 15 0 360 arc
- X gsave
- X 1 setgray fill
- X grestore
- X closepath
- X 0 setgray stroke
- X xleft 44 moveto Subject show
- X fontN
- X % position and print the page number
- X dup stringwidth pop 2 div neg xright 10 sub add 46 moveto show
- X fontH
- X grestore
- X modu 2 eq eof 0 ne or { showpage } if % do a 'form feed'
- X % if ready for it
- X eof 0 eq { newpage } if % reset parameters for next if not end of file
- X} def
- X
- X/endfile
- X{
- X /eof 1 def
- X endpage
- X} def
- X
- X/xo 36 def
- X/yo 0 def
- X/pageno 0 def
- X/modu pageno 3 mod def % get mod to work out page pos
- X/eof 0 def
- X
- X/weearc % draws a little arc to show where the holes go
- X{ newpath
- X xo yo 4 0 360 arc
- X closepath
- X fill
- X} def
- X
- X/filopage
- X{ gsave
- X% 24 -118 translate
- X /xstart filowidth modu mul def
- X /xstart xstart binderspace add def
- X /xfin xstart filowidth add def
- X modu 0 eq { % first break
- X /yo 130 def % show where the holes should be punched
- X weearc % except that they will normally be off the edge of
- X /yo 238 def % the page
- X weearc
- X /yo 346 def
- X weearc
- X /yo 639 def
- X weearc
- X /yo 742 def
- X weearc
- X /yo 850 def
- X weearc
- X } if
- X [1 4] 0 setdash % use dashed lines for marker
- X newpath
- X xstart 0 moveto
- X xfin 0 lineto
- X xfin filoheight lineto
- X stroke
- X grestore
- X} def
- X
- X/newpage
- X{
- X pageno 0 eq { % set initial values for landscape drawing
- X 0.5 0.5 scale
- X 90 rotate
- X -50 0 translate
- X gsave % save state for easy restore
- X /eof 0 def
- X } {
- X grestore gsave % return to preferred original state
- X } ifelse % initial setup
- X
- X /modu pageno 3 mod def % get mod to work out page pos
- X 0 0 filoheight sub translate % initial position (-filoheight)
- X filopage % draw neccessary page breaks
- X /times filowidth modu mul def % shift origin as far right as needed
- X /times times margin add def % move right by fudge factor 12
- X times 0 translate
- X /lct 0 def
- X /ypos filoheight 110 sub def
- X xleft ypos moveto
- X /pageno pageno 1 add def % add one for the next time
- X} def
- X
- X/showline
- X{
- X show
- X /ypos ypos 12 sub def
- X xleft ypos moveto
- X} def
- X
- Xnewpage % establish first page parameters
- SHAR_EOF
- chmod 0444 mp.pro.timeman.ps || echo "restore of mp.pro.timeman.ps fails"
- set `wc -c mp.pro.timeman.ps`;Sum=$1
- if test "$Sum" != "4820"
- then echo original size 4820, current size $Sum;fi
- rm -f s2_seq_.tmp
- echo "You have unpacked the last part"
- exit 0
-
-